package com.yonyou.pmclouds.reason.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.reason.entity.ProblemReasonRefVO;
import com.yonyou.pmclouds.reason.entity.ProblemReasonVO;

import java.util.Map;

public interface ProblemReasonQuery {
    /**
     * 查询租户底下的所有工序，不构造成树
     * <br>保护性限制2000条，有特殊情况再说
     */
    ProblemReasonVO[] queryReasonByTenant(String tenantid, byte enableStatus, byte category) throws BusinessException;

    ProblemReasonRefVO[] queryReasonRefByTenant(String tenantid, Byte category) throws BusinessException;

    ProblemReasonVO getById(String id) throws BusinessException;

    /**
     * 为工序的参照性质的批量查询、提供的接口
     * <br>
     * 该接口强制限制查询数量，以期避免一些错误
     *
     * @see com.yonyou.pmclouds.basecom.util.CommonProgramConsts#DEFAULT_MAX_QUERY_SIZE
     */
    Map<String, ProblemReasonRefVO> queryRefs(String[] ids) throws BusinessException;

    /**
     * 通过问题原因ids查找问题原因名
     *
     * @param ids
     * @return map，key是id，value是名称
     * @throws BusinessException
     */
    Map<String, String> queryNameByIds(String[] ids) throws BusinessException;

    ProblemReasonVO[] queryIdByNames(String[] names, String tenantId) throws BusinessException;
}
